package main

import (
	"fmt"
	"net/http"
	"synthesis-server/router"
	"synthesis-server/server"
	"time"
)

/*
	项目的启动程序
*/

func main() {

	fmt.Println("服务器启动!")

	newRouter := router.NewRouter()
	go server.MyServer.Start()

	s := &http.Server{
		Addr:         ":9998",
		Handler:      newRouter,
		ReadTimeout:  10 * time.Second,
		WriteTimeout: 10 * time.Second,
	}

	err := s.ListenAndServe()
	if err != nil {
		fmt.Println(err)
		fmt.Println("服务器启动失败!")
	}
}
